/*
 * @Author: cql-cql-cql
 * @Date:   2017-04-17 08:28:40
 * @Last Modified by:   cql-cql-cql
 * @Last Modified time: 2017-05-30 10:16:57
 */
var express = require("express");
var history = require('connect-history-api-fallback');
var app = express();
app.use(history());
var router = require("./router/router.js");
var session = require('express-session');
var bodyParser = require("body-parser");
app.use(session({
    secret: 'keyboard cat',
    resave: true,
    saveUninitialized: true
}));
app.use(bodyParser.json({ extended: false }))
app.use("/", express.static("./public"));//test或者production
app.use("/users/show", express.static("./avator"));
app.post("/users/register", router.doRegister);
app.post("/users/login", router.doLogin);
app.post("/users/info", router.poepleInfo);
app.post("/users/avator", router.avator);
app.post("/users/logout", router.logout);

app.post("/users/message", router.message)
app.post("/users/my", router.my)
app.get("/users/donations/:par", router.donations)
app.get("/users/count/:par", router.count)
app.post("/users/service", router.service)
app.post("/users/resetpass", router.resetpass)
app.post("/users/rank", router.rank)

//发现页面开始
app.post('/users/find/list', router.list);
app.post("/users/find/melist", router.melist)
app.post("/users/find/addComment", router.addComment)
app.post("/users/find/addReply", router.addReply)
app.post("/users/find/changeLike", router.changeLike)
//发现页面结束

app.listen(6666);
